# debug
import time
import socket
import wx

import panel

class TestFrame(wx.Frame):

    def __init__(self):
        super(TestFrame, self).__init__(None, wx.ID_ANY, "Test Frame")
        self.panel = panel.RfbPanel(parent=self)

    def attachToSocket(self, sock):
        self.panel.useSocket(sock)

if __name__ == "__main__":
    _sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    _sock.connect(("192.168.0.202", 5900))
    _sock.setblocking(False)
    _app = wx.PySimpleApp()
    _frame = TestFrame()
    _frame.Center()
    _frame.Show()
    _frame.attachToSocket(_sock)
    _app.MainLoop()
